package chap2_3;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author https://gitee.com/W_Jun
 * @version 1.0
 * @date 2021-11-25 23:44
 * @Description
 */
public class FileOutputStreamDemo03 {
    public static void main(String[] args) throws IOException {
        //创建字节输出流对象
        //FileOutputStream fos = new FileOutputStream("chapter02-字节流\\fos.txt");
        //追加写入
        FileOutputStream fos = new FileOutputStream("chapter02-字节流\\fos.txt", true);
        //写数据
        for (int i = 0; i < 10; i++) {
            fos.write("hello".getBytes());
            //换行
            fos.write("\r\n".getBytes());
        }

        //释放资源
        fos.close();
    }
}
